package com.baitengsoft.patentapimonitor.common.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Chen 2018/1/11
 */
public class SpiltUtils {

    /**
     * 逗号分隔的id拆出成数组
     */
    public static List<Integer> spiltIds(String ids){
        if(ids == null || ids.equals("")) return null;
        String[] split = ids.split(",");
        try {
            List<String> strings = Arrays.asList(split);
        }catch (Exception e){
            return null;
        }
        List<Integer> idList = new ArrayList<>();
        for(String s : split){
            Integer i = Integer.parseInt(s);
            idList.add(i);
        }
        return idList;
    }
}
